﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d"
    
	x:Class="SilverSynth.DemoUI.OscillatorControl" d:DesignHeight="360" Width="280" Margin="5" 
xmlns:local="clr-namespace:SilverSynth.DemoUI">
    <UserControl.Resources>
        <local:SliderValueConverter x:Key="converter"/>
        <local:WaveFormCollection x:Key="waves"/>
    </UserControl.Resources>
        <Grid x:Name="LayoutRoot" Background="White">
        <Border CornerRadius="20" BorderBrush="Black" BorderThickness="1" Margin="0">
        	<Border.Background>
        		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
        			<GradientStop Color="#FFFAF4F4"/>
        			<GradientStop Color="#FF533F1D" Offset="1"/>
        		</LinearGradientBrush>
        	</Border.Background>
            <StackPanel Margin="10">

                <StackPanel Orientation="Horizontal">
                	<TextBlock FontSize="12" FontWeight="Bold" x:Name="title" Text="Oscillator"/>
                	<HyperlinkButton Content="remove" HorizontalAlignment="Left" Margin="130,0,0,0" Click="HyperlinkButton_Click"/>
                </StackPanel>
                <TextBlock><Run Text="Wave Form:"/></TextBlock>
                <ComboBox x:Name="waveFormCombo" SelectionChanged="WaveFormChanged" HorizontalAlignment="Left" Width="75" ItemsSource="{Binding}" DataContext="{StaticResource waves}" SelectedIndex="0" />


                <TextBlock Margin="0 10 0 0"><Run Text="Frequency (Hz)"/></TextBlock>
                <StackPanel Orientation="Horizontal">
                    <Slider x:Name="hzSlider" HorizontalAlignment="Left" Width="200" Minimum="10" Maximum="2000" Value="440" />
                    <TextBlock Text="{Binding Value, Converter={StaticResource converter}, ConverterParameter=\{0:M\}, ElementName=hzSlider, Mode=OneWay}"/>
                </StackPanel>

                <TextBlock Margin="0 10 0 0"><Run Text="Pan (L + R):"/></TextBlock>
                <StackPanel Orientation="Horizontal">
                    <Slider x:Name="panSlider" HorizontalAlignment="Left" Width="200" Minimum="-32767" Maximum="32767" Value="0" />
                    <TextBlock Text="{Binding Value, Converter={StaticResource converter}, ConverterParameter=\{0:M\}, ElementName=panSlider, Mode=OneWay}"/>
                </StackPanel>

                <TextBlock Margin="0 10 0 0"><Run Text="Attenuation:"/></TextBlock>
                <StackPanel Orientation="Horizontal">
                    <Slider x:Name="attenuationSlider" HorizontalAlignment="Left" Width="200" Minimum="-80" Maximum="0" Value="-10" />
                    <TextBlock Text="{Binding Value, Converter={StaticResource converter}, ConverterParameter=\{0:M\}, ElementName=attenuationSlider, Mode=OneWay}"/>
                </StackPanel>

                <TextBlock Margin="0 10 0 0"><Run Text="Frequency Modulation Hz:"/></TextBlock>
                <StackPanel Orientation="Horizontal">
                    <Slider x:Name="hzModHzSlider" HorizontalAlignment="Left" Width="200" Minimum="0" Maximum="100" Value="-0" />
                    <TextBlock Text="{Binding Value, Converter={StaticResource converter}, ConverterParameter=\{0:M\}, ElementName=hzModHzSlider, Mode=OneWay}"/>
                </StackPanel>

                <TextBlock Margin="0 10 0 0"><Run Text="Frequency Modulation Amp:"/></TextBlock>
                <StackPanel Orientation="Horizontal">
                    <Slider x:Name="hzModAmpSlider" HorizontalAlignment="Left" Width="200" Minimum="0" Maximum="1000" Value="-0" />
                    <TextBlock Text="{Binding Value, Converter={StaticResource converter}, ConverterParameter=\{0:M\}, ElementName=hzModAmpSlider, Mode=OneWay}"/>
                </StackPanel>

                <TextBlock Margin="0 10 0 0"><Run Text="Amplitude Modulation Hz:"/></TextBlock>
                <StackPanel Orientation="Horizontal">
                    <Slider x:Name="ampModSlider" HorizontalAlignment="Left" Width="200" Minimum="0" Maximum="100" Value="-0" />
                    <TextBlock Text="{Binding Value, Converter={StaticResource converter}, ConverterParameter=\{0:M\}, ElementName=ampModSlider, Mode=OneWay}"/>
                </StackPanel>
            
            </StackPanel>
        </Border>
    </Grid>
</UserControl>